package cn.gx.kevin.service;

import cn.gx.kevin.common.tree.IListToTree;
import cn.gx.kevin.common.ui.ClientButton;
import cn.gx.kevin.domain.Org;

import java.io.OutputStream;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSONArray;
import cn.gx.kevin.service.IBaseService;
import org.springframework.web.multipart.MultipartFile;

/**
*Generate by Kevin's CodeBuilder
**/
public interface IOrgService extends IBaseService<Org,String>, IListToTree<Org> {
	
	 JSONArray getOrgJsonByPid(String pid, List<ClientButton> buttonlist) throws Exception;

	 JSONArray getOrgJsonByPid(String pid, List<ClientButton> buttonlist, Map<String, Object> params,int deep) throws Exception;

	 JSONArray getOrgJsonByPid(String pid) throws Exception;

	 JSONArray getOrgJsonByPid(String pid, Map<String, Object> params) throws Exception;

	 Org selectParentOrg(String id) throws Exception;

	 long importOrgs( MultipartFile xlsFile,String rootCode,String pid) throws Exception;

	 void exportOrgs( OutputStream outputStream,Map<String,Object> queryParams) throws Exception;

	 void deleteOrg(String id,boolean delSons) throws Exception;

	/**
	 * 根据pid获取下级所有子机构id集合，多维list，每个list最大为900个元素
	 * @param pid
	 * @return
	 * @throws Exception
	 */
	 List<List<String>> getAllChildsIdByPid(String pid) throws Exception;

	 List<Org> getRootOrgs() throws Exception;

	 void updateOrgCode() throws Exception;
}
